1. Field of the Invention
The invention relates to computer systems and computer software, and more particularly to identifying data sources in computer systems.
2. Description of the Related Art
Large business systems may include application servers that run multiple applications and/or multiple copies of the same application concurrently. Some or all of these applications may be transaction oriented and may be capable of conducting many transactions simultaneously. Each transaction may require at least one connection for each data resource to be accessed and each connection requires a certain amount of system resources. Given the potentially large number of data resources and applications involved in transactions, the amount of system resources devoted to connections required to support the transactions could be substantial.
Data sources in Java Database Connectivity (JDBC) are the connection factories through which connections to different databases may be obtained. The function of these data source objects is to hide backend database configuration specific details from the application and offer a uniform interface for obtaining connections, as defined in the JDBC specifications. For example, when it is determined that an application needs to communicate with a specific database resident on a backend system, the application server may typically instantiate a data source object corresponding to the database. The data source object may be associated with a connection pool including one or more connections to the database. In order to minimize the amount of database configuration specific information required by an application in order to obtain a connection, both the data source object and the application may use an abstract name to refer to the database. In this way, a developer writing application code may only need to know the abstract name for a database in order to obtain a connection to it.
Typically to obtain a connection to a database where my_database is an abstract name referring to a specific database on a backend system, application code would create a datasource object with my_database and call get_connection on the object. The data source object associated with the abstract name, my_database, will supply a connection to the desired database corresponding to the abstract name. A Java code example is as follows:                DataSource ds=new DataSource(abstract_name);        ds.getconnection( );        
Some applications may be large and complex and may be implemented by more than one developer. As a developer implements communications in a particular portion of an application, he may use abstract names to refer to the data sources that are to be accessed. These abstract names often aid the developer in recalling some characteristic of the data to be accessed. Developers implementing different portions of an application may use different abstract names for the same data resource.
In a typical application server, a separate data source object is instantiated for each abstract name of a data resource to be accessed by an application. For example, a company may have a database for storing human resources (HR) information resident on a backend system. A large application for manipulating the HR information may be written by several developers. One section of the application written by a first developer may require access to employee name information from the HR database and may use the abstract name “employee_names” to obtain a connection to the HR database. Another section of the application written by a second developer may require access to employee serial number information from the HR database and may use the abstract name “empnumber” to obtain a connection. Yet another section of the application written by a third developer may require access to employee salary information from the HR database and may use the abstract name “salary” to obtain a connection.
When the application is executed, the three sections obtain three different connections from data source objects associated with the three different abstract names corresponding to the singular HR database. This situation results in an inefficient use of system communication resources due to the lack of a standard method for discovering whether multiple data source entities refer to the same backend data resource.
For a transactional application this connection redundancy can result in the use of a more burdensome two-phase commit protocol, when if it were known that all connections were with the same data resource, a less-costly single-phase commit protocol could be used.